package com.d3works.apps.sale.db.repo;

import com.d3works.apps.sale.db.ConfiguratorCreator;
import com.d3works.apps.sale.service.configurator.ConfiguratorCreatorService;
import com.d3works.exception.service.TraceBackService;
import com.d3works.inject.Beans;
import javax.persistence.PostPersist;

public class ConfiguratorCreatorListener {

  @PostPersist
  private void onPostPersist(ConfiguratorCreator creator) {
    try {
      Beans.get(ConfiguratorCreatorService.class).init(creator);
    } catch (Exception e) {
      TraceBackService.trace(e);
      throw e;
    }
  }
}
